<?php echo $javascript->cacheEvents(false, true); ?><?php echo $javascript->codeBlock(); ?>

$(document).ready(function()
{
$("#selectall").click(function()				
{
var checked_status = this.checked;
$(".select-chekbox").each(function()
{
this.checked = checked_status; 
});
});					
}); <?php echo $javascript->blockEnd(); ?> <?php echo $form->create(array('action' => 'admin_delete_multiple_menu', 'method' => 'post', 'id' => 'admin_delete_multiple_menu', 'class' => '', 'enctype' => 'multipart/form-data')); ?>
<div id="mws-container" class="clearfix">
    <div class="container">
        <div class="mws-panel grid_8">
            <div class="mws-panel-header"> <span class="mws-i-24 i-table-1">Menu - Management</span> <span class="linktop"> 
                    <?php echo $this->Html->link('Add New Menu', array('controller' => 'setups', 'action' => 'admin_menu')); ?> </span> </div>
            <div class="mws-panel-body">
                <div class="dataTables_wrapper">
                    <table width="704" cellspacing="0" cellpadding="0" border="0"  class="mws-datatable-fn mws-table" id="users">
                        <tbody>
                            <tr>
                                <th rowspan="1" colspan="1" style="width: 91px;">
                                    <?php echo $form->input('', array('type' => 'checkbox', 'id' => 'selectall',
                                        'hiddenField' => false, 'class' => 'select-chekbox', 'label' => false)); ?></td>
                                <th class="sorting_asc" rowspan="1" colspan="1" style="width: 91px;" align="center">Sr No.</th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 91px;">Menu Title</th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 91px;">Menu Description</th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 91px;">Published</th>
                                <th class="sorting"rowspan="1" colspan="1" style="width: 91px;">View</th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 91px;">Edit</th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 91px;">Add Item</th>
                                <th class="sorting" rowspan="1" colspan="1" style="width: 91px;">Delete</th>
                            </tr>
                            <?php
                            $x = 1;
                            foreach ($menu_list as $menu) {    //pr($Page);
                                //exit;
                                if ($x % 2 == 0) {
                                    $class = "odd";
                                } else {
                                    $class = "even";
                                }
                                ?>
                                <tr class="gradeA <?php echo $class; ?>">

                                    <td  class=" sorting_1" width="39" valign="middle" height="25" bgcolor="#f0f0f0" align="center"><?php echo $form->input('Menu.id' . '', array('type' => 'checkbox', 'name' => 'data[checksel][]', 'hiddenField' => false, 'id' => 'checkselinput-' . $x, 'value' => '' . $menu['Menu']['id'] . '', 'class' => 'select-chekbox', 'label' => false)); ?></td>
                                    <td  class=" sorting_1" valign="middle" height="25" align="center"><?php echo $x; ?></td>
                                    <td  class=" sorting_1" valign="middle" height="20" align="center"><?php echo $html->link('' . $menu['Menu']['menu_title'] . '', array('controller' => 'setups', 'action' => 'admin_sub_menu_list', $menu['Menu']['id']), array('escape' => false, 'title' => 'View List')); ?></td>
                                    <td  class=" sorting_1" valign="middle" height="20" align="center"><?php echo $menu['Menu']['menu_description']; ?></td>
                                    <td  class=" sorting_1" valign="middle" align="center"><?php if ($menu['Menu']['published'] == 1) {
                                echo "Yes";
                            } else if ($menu['Menu']['published'] == 0) {
                                echo "NO";
                            } ?></td>
                                    <td  class=" sorting_1" valign="middle" align="center"><?php echo $this->Html->link('View', array('controller' => 'setups', 'action' => 'admin_sub_menu_list', $menu['Menu']['id']), array('title' => 'View Sub Items')) ?></td>
                                    <td  class=" sorting_1" valign="middle" align="center"><?php echo $html->link('Edit', array('controller' => 'setups', 'action' => 'admin_edit_menu', $menu['Menu']['id']), array('escape' => false)); ?></td>
                                    <td  class=" sorting_1" valign="middle" align="center">
    <?php echo $this->Html->link('Add Items', array('controller' => 'setups', 'action' => 'menu_item_create', $menu['Menu']['id'])) ?>
                                    </td>
                                    <td  class=" sorting_1" valign="middle" align="center">
                                        <?php
                                        if ($menu['Menu']['id'] != 8) {
                                            echo $this->Html->link('...', array('controller' => 'setups', 'action' => 'admin_delete_menu', $menu['Menu']['id']), null, 'Are you sure?');
                                        }
                                        ?></td>
                                </tr>
                                <?php
                                $x++;
                            }
                            ?>
                        </tbody>
                    </table>
                    <div class="dataTables_info">
                        <input type="submit" onclick="return confirm('Are you sure to delete Selected Users?');" value="Delete Selected" class="delete_button_">
                    </div>
                    <div class="dataTables_paginate paging_full_numbers"> <span class="first paginate_button paginate_button_disabled">First</span> <span class="previous paginate_button paginate_button_disabled">Previous</span> <span><span class="paginate_active">1</span> <span class="paginate_button">2</span> <span class="paginate_button">3</span> <span class="paginate_button">4</span> <span class="paginate_button">5</span> </span> <span class="next paginate_button">Next</span> <span class="last paginate_button">Last</span> </div>
                </div>
            </div>
        </div>
    </div>
</div>
